home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tpspool.com / SPLTEST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-06-04  |  1.8 KB  |  64 lines

  1. Program Spooler_Test;
  2.  
  3. uses CRT,TP55SPL;
  4.  
  5.  
  6. VAR
  7.   Ch : Char;
  8.   X,Result : integer;
  9.   splstat : SplStatType;
  10.  
  11.  
  12. BEGIN
  13.   FOR X := 1 to 10 DO   { Write out ten lines of text to main memory spooler. }
  14.     BEGIN
  15.       Writeln(SPL,'Hello, Hello, is there anybody out there ? ',X,' ',Memavail);
  16.       Writeln(X);
  17.     END;
  18.  
  19.   Spoolerstatus(splstat);
  20.   While splstat.BytesToPrint <> 0 DO          { Wait while spooler empties }
  21.     BEGIN                                     {  before going on.          }
  22.       Spoolerstatus(splstat);
  23.       GotoXY(40,Wherey);
  24.       Write('Bytes left to print : ',splstat.BytesToPrint:6);
  25.     END;
  26.   Writeln;
  27.  
  28.   Close(Spl);            { To change spooler mode, first close it. }
  29.  
  30.       { Check and see if there's an expanded memory manager loaded, and that
  31.          there's enough memory available for the spooler. }
  32.  
  33.   IF Spool_In_EMS(32768) <> 0 THEN
  34.      Writeln( 'EMS spooler not installed installed.')
  35.   ELSE
  36.     BEGIN
  37.       Rewrite(SPL);
  38.       Writeln('Spooling in EMS. ');
  39.       FOR X := 11 to 20 DO
  40.         BEGIN
  41.           Writeln(SPL,'Spooled in EMS. Hello, Hello, is there anybody out there ? ',X,' Mem Avail ',memavail);
  42.           Writeln(X);
  43.         END;
  44.       Spoolerstatus(splstat);
  45.       While splstat.BytesToPrint <> 0 DO
  46.         BEGIN
  47.           Spoolerstatus(splstat);
  48.           GotoXY(40,Wherey);
  49.           Write('Bytes left to print : ',splstat.BytesToPrint:6);
  50.         END;
  51.       Writeln;
  52.       Close(SPL);
  53.     END;
  54.  
  55.  
  56.   Direct_To_Printer;           { Send output direct to the printer. }
  57.   Rewrite(SPL);
  58.   FOR X := 21 to 30 DO
  59.     BEGIN
  60.       Writeln(SPL,'Direct to printer. Is there anybody out there ? ',X,' Mem Avail ',memavail);
  61.       Writeln(X);
  62.     END;
  63.   Writeln('Finished.');
  64. END.